import http from "@/utils/http";
import type {ResponseData} from "@/types/user";
import type {Banner, BannerDTO, CategoryGoods} from "@/types/home";
import type {Goods} from "@/types/layout";

export const getHomeBannerAPI = (params:BannerDTO={distributionSite:1})=>{
  return http<ResponseData<Banner[]>>({
    url:'/home/banner',
    params
  })
}

export const getHomeNewAPI =()=>{
  return http<ResponseData<Goods>>({
    url:'/home/new'
  })
}

export const getHomeHotAPI=()=>{
  return http<ResponseData<Goods>>({
    url:'/home/hot'
  })
}

export const getHomeGoodsAPI =()=>{
  return http<ResponseData<CategoryGoods[]>>({
    url:'/home/goods'
  })
}